package it.univaq.di.helpdesk.business.common;


public abstract class HelpDeskServiceFactory {
	
	private static HelpDeskServiceFactory instance;
	
	public abstract UserService getUserService();
	public abstract TicketService getTicketService();
	public abstract OfficeService getOfficeService();
	public abstract FaqService getFaqService();
	public abstract DeviceService getDeviceService();
	
	protected HelpDeskServiceFactory() {
	}
	
	public synchronized static HelpDeskServiceFactory getInstance() {
		if (instance==null) {
			throw new RuntimeException();
		}
		return instance;
	}
	

	public synchronized static void setInstance(HelpDeskServiceFactory factory) {
		if (instance!=null) {
			throw new RuntimeException();
		}
		instance = factory;
		
	}
}
